package com.yehangtech.designpattern.创建型_单例.demo;

/**
 * 懒汉式（线程安全）
 */
public class Singleton_03 {
    private static Singleton_03 singleton03;

    private Singleton_03(){
    }

    public static synchronized Singleton_03 newInstance(){
        if (null==singleton03){
            singleton03=new Singleton_03();
            return singleton03;
        }
        return singleton03;
    }
}
